#include <iostream>
using namespace std;
template <class T>
class Queue{

public:
     T * q;
     int n, head, tail;
public:
       Queue(int maxn){

           q=new T[maxn+1];
           n=maxn+1; head=n; 
           tail=0;



       }

       int  emty() const {
            return ((head%n)==tail);


       }
        void put(T k){
            q[tail++]=k; tail=tail%n;


        }
          T get(){
              head=head%n;  return q[head++];

          }
};
int main(){

    Queue<int>a(10);
    a.put(13);
    a.put(45);
    a.put(12);
    a.put(10);
    a.put(30);
    a.put(45);
    while(!a.emty()){
        cout<<a.get()<<"  ";


    }

    return 0;
}